package com.yonyou.brigade.third_parties.tuniu.controller;

import com.alibaba.fastjson.JSONObject;
import com.yonyou.brigade.basic_init.service.IUserCenterService;
import com.yonyou.ybzboot.uc.dto.UcUserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/9/3.
 */
@Controller
@RequestMapping("/tuniu")
public class ucUserController {

    @Autowired
    @Qualifier("userCenterServiceImpl")
    private IUserCenterService userCenterService;

    @RequestMapping(value = "/getUcUser",method = RequestMethod.POST)
    public @ResponseBody
    Map<String, String> testUcUser(@RequestBody JSONObject body){
        Map<String,String> result = new HashMap<>();
        List<UcUserDto> ucUserDtoList = userCenterService.getUcUserDtoByOrg("es0jmgsl","0001F410000000000P18");
        for (UcUserDto ucUserDto:ucUserDtoList){
            ucUserDto.getPersonName();
        }
        result.put("result","成功");
        return result;
    }
}